package main

import "strings"

func main() {
	println(strings.Index("abcdefd", "d"))
}

func reversePrefix(word string, ch byte) string {
	wordBytes := []byte(word)
	for left, right := 0, strings.Index(word, string(ch)); left < right; left, right = left+1, right-1 {
		wordBytes[left], wordBytes[right] = wordBytes[right], wordBytes[left]
	}
	return string(wordBytes)
}
